//
//@author jltxseo
// Created by junlintianxia on 2018/8/2.
//

#ifndef LEARNOPENGLANDROIDPRO_TUTORIALLESSONTHREE_H
#define LEARNOPENGLANDROIDPRO_TUTORIALLESSONTHREE_H

#include "../TutorialLesson.h"
#include "graphics/Matrix.h"

class TutorialLessonThree : public TutorialLesson {
public:
    TutorialLessonThree();

    ~TutorialLessonThree();

    virtual void create() override;

    virtual void change(int width, int height) override;

    virtual void draw() override;

    void drawTriangle();

    void drawPoint();

private:
    //This triangle is red, green, and blue.
    // 表示3个顶点和颜色的向量的数组
    GLfloat triangle1VerticesData[21] = {
            // X, Y, Z,
            // R, G, B, A
            -0.5f, -0.25f, 0.0f,
            1.0f, 0.0f, 0.0f, 1.0f,

            0.5f, -0.25f, 0.0f,
            0.0f, 0.0f, 1.0f, 1.0f,

            0.0f, 0.559016994f, 0.0f,
            0.0f, 1.0f, 0.0f, 1.0f
    };

    GLfloat pointVerticesData[7] = {
            // X, Y, Z,
            // R, G, B, A
            0.0f, 0.0f, 0.0f,
            1.0f, 1.0f, 1.0f, 1.0f,
    };

    Shader *mShader;
    Shader *mPointShader;
    Matrix *mViewMatrix;
    Matrix *mModelMatrix;
    Matrix *mProjectionMatrix;
    Matrix *mMVPMatrix;
};


#endif //LEARNOPENGLANDROIDPRO_TUTORIALLESSONTHREE_H
